package cl.agrosuper.util
{
    import flash.events.Event;
    import flash.net.NetworkInfo;
    import flash.net.NetworkInterface;
    //------------------------------------------------------
    public class NetworkInterfaceDetector 
    {
        private var ni:NetworkInfo = NetworkInfo.networkInfo;
        public var active:String = "none";
        //------------------------------------------------------
        public function NetworkInterfaceDetector()
        {  
            //ni.addEventListener(Event.NETWORK_CHANGE,checkNetworkInterface);
            //checkNetworkInterface();   
        }
		
		public static function internetDisponible():Boolean{
			var interfaceVector:Vector.<NetworkInterface > = NetworkInfo.networkInfo.findInterfaces();
			var active:Boolean = false;
			
			for each (var item:NetworkInterface in interfaceVector)
			{
				if(item.active)
					return true;
			}
			
			return false;
		}
    }
}